home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / configure.in < prev    next >
Text File  |  1994-05-20  |  16KB  |  570 lines

  1. dnl Autoconf sets the quotes to [ and ], which hoses shell commands.
  2. dnl We get rid of the quotes altogether, and turn them on for AC_*.
  3. changequote(,)dnl
  4. #! /bin/sh
  5.  
  6. # Configuration script for the GNU C Library.
  7. dnl You can ignore the following line if you are reading this sentence.
  8. # DO NOT EDIT!  This script is generated from configure.in; edit that instead.
  9.  
  10. # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  11. # This file is part of the GNU C Library.
  12.  
  13. # The GNU C Library is free software; you can redistribute it and/or
  14. # modify it under the terms of the GNU Library General Public License as
  15. # published by the Free Software Foundation; either version 2 of the
  16. # License, or (at your option) any later version.
  17.  
  18. # The GNU C Library is distributed in the hope that it will be useful,
  19. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  21. # Library General Public License for more details.
  22.  
  23. # You should have received a copy of the GNU Library General Public
  24. # License along with the GNU C Library; see the file COPYING.LIB.  If
  25. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  26. # Cambridge, MA 02139, USA.
  27.  
  28. #
  29. #    Configure the GNU C Library.
  30. #
  31.  
  32. prog="`basename $0`"
  33.  
  34. # All the standard GNU configure options are accepted but only
  35. # --nfp, --with-gnu-ld, and --with-gnu-as are meaningful.
  36. nfp=
  37. gnu_ld=
  38. gnu_as=
  39. prefix=
  40. exec_prefix=
  41. verbose=
  42.  
  43. next=
  44. lose=
  45. for arg in $*; do
  46.   if [ x$next != x ]; then
  47.     eval "$next=\$arg"
  48.     next=
  49.   else
  50.     case $arg in
  51.     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  52.        srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
  53.        ;;
  54.     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  55.        next=srcdir
  56.        ;;
  57.     -target | --target | --targe | --targ | --tar | --ta | --t)
  58.        next=target
  59.        ;;
  60.     -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  61.        target=`echo $arg | sed 's/-*t[a-z]*=//'`
  62.        ;; 
  63.  
  64.     -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
  65.        gnu_ld=--with-gnu-ld
  66.        ;;
  67.  
  68.     -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
  69.        gnu_as=--with-gnu-as
  70.        ;;
  71.  
  72.     -nfp | --nfp | --nf | --n)
  73.        nfp=--nfp
  74.        ;;
  75.  
  76.     -with-* | --with-*)
  77.       # For `--with-foo=bar', do "with_foo='bar'".
  78.       # For `--with-fnord', do "with_fnord=yes".
  79.       # These variables may be examined by sysdep configure fragments.
  80.       eval `echo "$arg" | sed '{s/^-*//;s/-/_/g
  81. s/^\([^=]*\)=\(.*\)$/\1='\''\2'\''/;s/^\([^=]*\)$/\1=yes/;}'`
  82.       ;;
  83.  
  84.     -x | --x)
  85.       ;; # ignored
  86.  
  87.     # For backward compatibility, also recognize exact --exec_prefix.
  88.     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  89.        exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'`
  90.        ;;
  91.     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  92.        next=exec_prefix
  93.        ;;
  94.  
  95.     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  96.        prefix=`echo $arg | sed 's/[-a-z_]*=//'`
  97.        ;;
  98.     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  99.        next=prefix
  100.        ;;
  101.  
  102.     -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  103.       # Autoconf-generated code below will test this.
  104.       verbose=yes
  105.       ;;
  106.  
  107.     -*)
  108.        echo "Invalid option \`$arg'" 1>&2
  109.        lose=yes
  110.        ;;
  111.     *)
  112.        if [ ! "$target" ]; then
  113.      target=$arg
  114.        else
  115.      lose=yes
  116.        fi
  117.        ;;
  118.     esac
  119.   fi
  120. done
  121.  
  122. # NEXT will be set iff we have seen an option that wants an arg, but no arg.
  123. if [ "$next" ]; then
  124.   echo "$0: the \`--${next}' option requires an argument" >&2
  125.   lose=yes
  126. fi
  127.  
  128. dnl This deals with setting srcdir if it needs to be set.
  129. changequote([,])
  130. AC_PREPARE(features.h)
  131. AC_LANG_C
  132. changequote(,)
  133.  
  134. # Decanonicalize srcdir so we can tell when we are configuring in srcdir.
  135. if [ "`(cd ${srcdir}; pwd)`" = "`pwd`" ]; then
  136.   srcdir=.
  137. fi
  138.  
  139. if [ ! "$target" ]; then
  140.   target=`$srcdir/config.guess`
  141.   test -n "$target" && echo "No target given; guessing target is ${target}."
  142. fi
  143.  
  144. if [ "$lose" = yes -o ! "$target" ]; then
  145.   echo "\
  146. Usage: $prog [--srcdir=DIR] [--prefix=DIR] [--exec-prefix=DIR]
  147.          [--nfp] [--with-gnu-ld] [--with-gnu-as] TARGET" >&2
  148.   if [ -r config.status ]; then
  149.     cat config.status >&2
  150.   fi
  151.   exit 1
  152. fi
  153.  
  154. # Done parsing the arguments.
  155.  
  156. # This will get text that should go into config.make.
  157. config_vars=
  158.  
  159. # Check for a --with-gmp argument and set gmp-srcdir in config.make.
  160. case "$with_gmp" in
  161. yes) echo "$prog: --with-gmp requires an argument; use --with-gmp=DIRECTORY"
  162.      exit 1 ;;
  163. '') ;;
  164. *) config_vars="$config_vars
  165. gmp-srcdir = $with_gmp" ;;
  166. esac
  167.  
  168. # Canonicalize the configuration name.
  169. config=`$srcdir/config.sub $target`
  170. if [ ! "$config" ]; then
  171.   # config.sub has written an error message.
  172.   exit 1
  173. fi
  174.  
  175. sysdep_dir=$srcdir/sysdeps
  176.  
  177. # machine-vendor-os
  178. eval "`echo $config | \
  179.        sed 's/^\(.*\)-\(.*\)-\(.*\)$/\
  180. config_machine=\1 config_vendor=\2 config_os=\3/'`"
  181.  
  182. # We keep the original values in `$config_*' and never modify them, so we
  183. # can write them unchanged into config.make.  Everything else uses
  184. # $machine, $vendor, and $os, and changes them whenever convenient.
  185. machine=$config_machine
  186. vendor=$config_vendor
  187. os=$config_os
  188.  
  189. # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
  190. os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
  191.  
  192. case "$machine" in
  193. i[34]86)
  194.   machine=i386/$machine ;;
  195. sparc[6789])
  196.   machine=sparc/$machine ;;
  197. m68k)
  198.   machine=m68k/m68020 ;;
  199. m680?0)
  200.   machine=m68k/$machine ;;
  201. m88k)
  202.   machine=m88k/m88100 ;;
  203. m88???)
  204.   machine=m88k/$machine ;;
  205. mips|r2000)
  206.   machine=mips/r3000 ;;
  207. r[34]000)
  208.   machine=mips/$machine ;;
  209. esac
  210.  
  211. case "$os" in
  212. gnu*)
  213.   base_os=mach/hurd ;;
  214. netbsd* | 386bsd*)
  215.   base_os=unix/bsd/bsd4.4 ;;
  216. osf1* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
  217.   base_os=unix/bsd ;;
  218. linux* | sysv* | isc* | esix* | sco* | minix* | irix4*)
  219.   base_os=unix/sysv ;;
  220. solaris[2-9]*)
  221.   base_os=unix/sysv/sysv4 ;;
  222. esac
  223.  
  224. case "$os:$base_os" in
  225. gnu* | linux* | bsd4.4* | *:bsd4.4)
  226.   gnu_ld=--with-gnu-ld
  227.   gnu_as=--with-gnu-as
  228. esac
  229.  
  230. # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
  231. tail=$os
  232. ostry=$os
  233. while o=`echo $tail | sed 's/\.[^.]*$//'`; [ $o != $tail ]; do
  234.   ostry="$ostry /$o"
  235.   tail=$o
  236. done  
  237. o=`echo $tail | sed 's/[0-9]*$//'`
  238. if [ $o != $tail ]; then
  239.   ostry="$ostry /$o"
  240. fi
  241.  
  242. # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
  243. base=
  244. tail=$base_os
  245. while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$b" ]; do
  246.   set $b
  247.   base="$base /$1"
  248.   tail="$2"
  249. done
  250.  
  251. # For sparc/sparc9, try sparc/sparc9 and then sparc.
  252. mach=
  253. tail=$machine
  254. while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$m" ]; do
  255.   set $m
  256.   mach="$mach /$1"
  257.   tail="$2"
  258. done
  259.  
  260. # Find what sysdep directories exist.
  261. sysnames=
  262. for b in $base ''; do
  263.   for v in /$vendor ''; do
  264.     for o in /$ostry ''; do
  265.       for m in $mach ''; do
  266.         if [ -d $sysdep_dir$b$v$o$m ]; then
  267.           sysnames="$sysnames $b$v$o$m"
  268.       [ "$o" -o "$b" ] && os_used=t
  269.       [ "$m" ] && machine_used=t
  270.     fi
  271.       done
  272.     done
  273.   done
  274. done
  275.  
  276. if [ ! "$os_used" -a "$os" != none ]; then
  277.   echo Operating system $os is not supported. >&2
  278.   exit 1
  279. fi
  280. if [ ! "$machine_used" -a "$machine" != none ]; then
  281.   echo The $machine is not supported. >&2
  282.   exit 1
  283. fi
  284.  
  285. # We have now validated the configuration.
  286.  
  287. PWD=`pwd`
  288. echo Configuring the GNU C library in $PWD
  289. echo on `(hostname || uname -n) 2>/dev/null | sed 1q` for ${config}.
  290.  
  291. # Remove the leading slashes.
  292. sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
  293.  
  294. # Prepend the machine's FPU directory unless --nfp.
  295. if [ ! "$nfp" -a -d $sysdep_dir/$machine/fpu ]; then
  296.   sysnames="${machine}/fpu $sysnames"
  297. fi
  298.  
  299. # Expand the list of system names into a full list of directories
  300. # from each element's parent name and Implies file (if present).
  301. set $sysnames
  302. while [ $# -gt 0 ]; do
  303.   name=$1
  304.   shift
  305.  
  306.   if [ -f $sysdep_dir/$name/Implies ]; then
  307.     # Collect more names from the `Implies' file (removing comments).
  308.     implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
  309.     for x in $implied; do
  310.       test -d $sysdep_dir/$x || echo "Warning: $name implies nonexistent $x">&2
  311.     done
  312.   else
  313.     implied=
  314.   fi
  315.  
  316.   # Add NAME to the list of names.
  317.   names="$names $name"
  318.  
  319.   # Find the parent of NAME, using the empty string if it has none.
  320.   parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
  321.  
  322.   # Add the names implied by NAME, and NAME's parent (if it has one), to
  323.   # the list of names to be processed (the argument list).  We prepend the
  324.   # implied names to the list and append the parent.  We want implied
  325.   # directories to come before further directories inferred from the
  326.   # configuration components; this ensures that for sysv4, unix/common
  327.   # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
  328.   # after sysv4).
  329.   sysnames="`echo $implied $* $parent`"
  330.   if [ "$sysnames" != "" ]; then
  331.     set $sysnames
  332.   fi
  333. done
  334.  
  335. # Add the default directories.
  336. names="$names generic stub"
  337.  
  338. # Now uniquize the list.
  339. seen=
  340. sysnames=
  341. for name in $names; do
  342.   if echo "$seen" | fgrep -x $name >/dev/null; then
  343.     # Already in the list.
  344.     true;
  345.   else
  346.     # A new one.
  347.     if [ "$seen" = "" ]; then
  348.       seen="$name" sysnames="$name"
  349.     else
  350.       seen="$seen
  351. $name"
  352.       sysnames="$sysnames $name"
  353.     fi
  354.   fi
  355. done
  356.  
  357. echo Using system-dependent files from directories:
  358. for dir in $sysnames; do echo "    $dir"; done
  359.  
  360. changequote([,])dnl The world is now safe for m4, and unsafe for shell.
  361. dnl Be sure to add each macro used here to aclocal.m4 (which see).
  362.  
  363. dnl Without this hack, AC_PROG_INSTALL will expand ${srcdir} in the name.
  364. define([AC_PROG_INSTALL_INSTALL_SH], ['$(..)install.sh -c'])
  365. AC_PROG_INSTALL
  366. AC_PROG_RANLIB
  367.  
  368. AC_PROG_CC
  369. AC_PROG_CPP
  370.  
  371. echo checking for signed size_t type
  372. echo '#include <stddef.h>
  373. FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
  374. eval "$CPP conftest.c 2>/dev/null" \
  375. | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null \
  376. || {
  377.   dnl Do this by hand instead of AC_DEFINE so we can use -U to avoid warnings.
  378.   DEFS="$DEFS -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned"
  379.   (echo '#undef __SIZE_TYPE__';
  380.    echo '#define __SIZE_TYPE__ unsigned') >> confdefs.h
  381.   test -n "$verbose" && echo '    using unsigned int for size_t'
  382. }
  383. rm -f conftest*
  384.  
  385. AC_COMPILE_CHECK([libc-friendly stddef.h],
  386. [#define __need_size_t
  387. #define __need_wchar_t
  388. #include <stddef.h>
  389. #define __need_NULL
  390. #include <stddef.h>], [size_t size; wchar_t wchar;
  391. #ifdef offsetof
  392. #error stddef.h ignored __need_*
  393. #endif
  394. if (&size == NULL || &wchar == NULL) abort ();],
  395. [config_vars="$config_vars
  396. stddef.h = # The installed <stddef.h> seems to be libc-friendly."
  397. test -n "$verbose" && echo '    installed stddef.h looks friendly'])
  398.  
  399. changequote(,)dnl The world is again safe for shell scripts.
  400.  
  401. echo 'checking for need to use -P to assemble .S files'
  402. cat > conftest.S <<EOF
  403. #include "confdefs.h"
  404. /* Nothing whatsoever.  */
  405. EOF
  406. ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null || {
  407.   config_vars="$config_vars
  408. asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
  409.   test -n "$verbose" && echo '    using -P flag'
  410. }
  411. rm -f conftest*
  412.  
  413. # Iterate over all the sysdep directories we will use, running their
  414. # configure fragments, and looking for a uname implementation.
  415. uname=
  416. for dir in $sysnames; do
  417.   if test -r $sysdep_dir/$dir/configure; then
  418.     echo running configure fragment for $dir
  419.     . $sysdep_dir/$dir/configure
  420.   fi
  421.   test ! "$uname" && \
  422.   test -r $sysdep_dir/$dir/uname.c -o -r $sysdep_dir/$dir/uname.S && uname=$dir
  423. done
  424.  
  425. # If we will use the generic uname implementation, we must figure out what
  426. # it will say by examining the system, and write the results in config-name.h.
  427. if [ "$uname" = generic ]; then
  428.  
  429.   echo trying to guess OS release and version for uname
  430.  
  431.   kernel_release=
  432.   kernel_version=
  433.  
  434.   if [ ! "$release" -o ! "$version" ]; then
  435.     if [ -r /vmunix ]; then
  436.       kernel_id=`strings /vmunix | grep UNIX`
  437.     elif [ -r /dynix ]; then
  438.       kernel_id=`strings /dynix | grep DYNIX`
  439.     else
  440.       kernel_id=
  441.     fi
  442.     if [ "$kernel_id" ]; then
  443.       kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
  444.       kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
  445.     fi
  446.   fi
  447.  
  448.   sysname=`echo $os | sed 's/[0-9.]*$//'`
  449.   if [ $sysname != $os ]; then
  450.     config_release=`echo $os | sed s/$sysname//`
  451.   fi
  452.  
  453.   if [ "$release" ]; then
  454.     # All is well.
  455.     true
  456.   elif [ x`echo "$config_release" | sed "s/^$kernel_release//"` \
  457.      != x$config_release ]; then
  458.     # The configuration release is a substring of the kernel release.
  459.     release=$kernel_release
  460.   elif [ x$config_release != x ]; then
  461.     release=$config_release
  462.   elif [ x$kernel_release != x ]; then
  463.     release=$kernel_release
  464.   else
  465.     cat <<END
  466. I don't know what release of $sysname you are using.  Please enter the
  467. release number now.  This information is used only for the \`uname' function,
  468. so it is not critical.
  469. END
  470.     read release
  471.     if [ ! "$release" ]; then
  472.       release=unknown
  473.     fi
  474.   fi
  475.  
  476.   if [ "$version" ]; then
  477.     # All is well.
  478.     true
  479.   elif [ ! "$kernel_version" ]; then
  480.     cat <<END
  481. I don't know what version of $sysname $release you are using.  Please enter
  482. the version number now.  This information is used only for the uname
  483. function, so it is not critical.
  484. END
  485.     read version
  486.     if [ ! "$version" ]; then
  487.       version=unknown
  488.     fi
  489.   else
  490.     version=$kernel_version
  491.   fi
  492.  
  493.   cat > config-name.h <<END
  494. /* This file was generated automatically by configure.  Do not edit.
  495.    This is used by the generic uname function.  */
  496. #define UNAME_SYSNAME "${sysname}"
  497. #define UNAME_RELEASE "${release}"
  498. #define UNAME_VERSION "${version}"
  499. #define UNAME_MACHINE "${config_machine}-${config_vendor}"
  500. END
  501.  
  502.   system_name="$sysname $release version $version on $vendor $machine"
  503. else
  504.   # Not generic uname.  We don't need config-name.h at all.
  505.   system_name=$config
  506. fi
  507.  
  508. if [ "$gnu_ld" ]; then
  509.   DEFS="$DEFS -DHAVE_GNU_LD"
  510. fi
  511. if [ "$gnu_as" ]; then
  512.   DEFS="$DEFS -DHAVE_GNU_AS"
  513. fi
  514.  
  515. (
  516.   echo '# This file was generated automatically by configure.  Do not edit.'
  517.   echo '# Put configuration parameters in configparms instead.'
  518.   echo "config-machine = ${config_machine}"
  519.   echo "config-vendor = ${config_vendor}"
  520.   echo "config-os = ${config_os}"
  521.   echo "config-sysdirs = ${sysnames}"
  522.   if [ "$prefix" ]; then
  523.     echo "prefix = ${prefix}"
  524.   fi
  525.   if [ "$exec_prefix" ]; then
  526.     echo "exec_prefix = ${exec_prefix}"
  527.   fi
  528.   echo "config-defines = ${DEFS}"
  529.   for var in INSTALL INSTALL_PROGRAM INSTALL_DATA RANLIB; do
  530.     eval "echo \"${var} = \${$var}\""
  531.   done
  532.   echo "$config_vars"
  533. ) > config.make
  534. echo "Wrote config.make in $PWD."
  535.  
  536. if [ $srcdir != . ]; then
  537.   if [ $srcdir = .. ]; then
  538.     cwd=`pwd`
  539.     objdir=`basename $cwd`
  540.   else
  541.     objdir=`pwd`
  542.   fi
  543.   cat > Makefile <<END
  544. # This file was generated automatically by configure.  Do not edit.
  545. srcdir = $srcdir
  546.  
  547. all .DEFAULT:
  548.     \$(MAKE) -C \$(srcdir) objdir=\`pwd\` \$@
  549. END
  550.  
  551. echo "Wrote Makefile in $PWD."
  552. fi
  553.  
  554. cat > config.status <<END
  555. #!/bin/sh
  556. # This file was generated automatically by configure.  Do not edit.
  557. # The GNU C library was configured in $PWD for
  558. # $system_name as follows:
  559. release=$release version=$version $0 $configure_args \$*
  560. END
  561. chmod a+x config.status
  562. echo "Wrote config.status in $PWD."
  563.  
  564. exit 0
  565. dnl This gets rid of the random stuff autoconf has stuffed in weird places.
  566. divert(-1)dnl AC_This is here so I can search for `AC_' to find the frobs.
  567. dnl Local Variables:
  568. dnl compile-command: "autoconf"
  569. dnl End:
  570.